import Vue from 'vue'
import Router from 'vue-router'
import Login from '../components/Login.vue'
import Register from '../components/Register.vue'
import ForgetPassword from  '../components/ForgetPassword'
import ChangePassword from '../components/ChangePassword'
import PerfectInformation from '../components/personnal/PerfectInformation'
import Main from '../components/main/Main'
import HomePage from '../components/main/home/HomePage'
import Message from '../components/main/message/Message'
import Company from '../components/main/company/Company'
import Me from '../components/main/me/Me'
import LongTermJob from '../components/main/workType/LongTermJob'
import BellWork from '../components/main/workType/BellWork'
import NearbyJob from '../components/main/workType/NearbyJob'
import Internship from '../components/main/workType/Internship'
import  More from '../components/main/me/More'
import  ResetPassword from '../components/main/me/ResetPassword'
import JobMessage from '../components/main/home/JobMessage'
import CompanyDetail from '../components/main/company/companyDetail'

  Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path:'/forgetPassword',
      name:'ForgetPassword',
      component:ForgetPassword,
    },
    {
      path:'/changePassword',
      name:'ChangePassword',
      component:ChangePassword
    },{
      path:'/editPerfectInformation',
      name:"PerfectInformation",
      component:PerfectInformation,
      meta: { requiresAuth: true }
    },
    {
      path:'/main',
      name:'Main',
      component:Main,
      children:[
          {path:'homePage', name:'Message', component:HomePage},
          {path:'message', name:'Message', component:Message},
          {path:'company', name:'Company', component:Company},
          {path:'me', name:'Me', component:Me}
        ],
      meta: { requiresAuth: true }
    },
    {
      path:'/longTermJob',
      name:'LongTermJob',
      component:LongTermJob,
      meta: { requiresAuth: true }
    },
    {
      path:'/bellWork',
      name:'BellWork',
      component:BellWork,
      meta: { requiresAuth: true }
    },
    {
      path:'/nearbyJob',
      name:'NearbyJob',
      component:NearbyJob,
      meta: { requiresAuth: true }
    },
    {
      path:'/internship',
      name:'Internship',
      component:Internship,
      meta: { requiresAuth: true }
    },
    {
      path:'/more',
      name:'More',
      component:More,
      meta: { requiresAuth: true }
    },
    {
      path:'/resetPassword',
      name:'ResetPassword',
      component:ResetPassword,
      meta: { requiresAuth: true }
    },
    {
      path:'/jobMessage',
      name:JobMessage,
      component:JobMessage,
      meta: { requiresAuth: true }
    },
    {
      path:'/companyDetail',
      name:CompanyDetail,
      component:CompanyDetail,
      meta: { requiresAuth: true }
    }
  ]
})
